#ifndef __PCF8563T_H
#define __PCF8563T_H
#include "stm32f4xx_hal.h"

/*I2C的数据传输地址*****************************/
#define ADDR_PCF8563     0xa2

/*RTC各个时间数据寄存器地址**********************/
#define ADDR_SECOND      0x02
#define ADDR_MIN         0x03
#define ADDR_HOUR        0x04
#define ADDR_DAY         0x05
#define ADDR_MONTH       0x07
#define ADDR_YEAR        0x08

/*RTC_Struct************************************/
typedef struct{
	uint8_t year;
	uint8_t month;
	uint8_t day;
	uint8_t hour;
	uint8_t min;
	uint8_t second;

}Datetime_Structure;

extern Datetime_Structure Datetime;

/*函数声明**************************************/
void rtc_init(void);
void rtc8563_write(uint8_t rtc_addr,uint8_t rtc_data);
uint8_t rtc8563_read(uint8_t rtc_addr);
void rtc_set_time(uint8_t year,uint8_t month,uint8_t day,uint8_t hour,uint8_t min,uint8_t second);
Datetime_Structure rtc_get_time(void);


#endif

